home *** CD-ROM | disk | FTP | other *** search
- property pSpr, pLastDirection, pOldTabs, pLastVisible
-
- on beginSprite me
- pSpr = sprite(me.spriteNum)
- pSpr.visible = 0
- pLastDirection = #bottom
- pOldTabs = pSpr.member.Tabs
- customFont(pSpr.member)
- end
-
- on endSprite me
- pSpr.visible = 1
- end
-
- on mouseEnter me
- showToolTip(sprite(me.spriteNum), #contentslist, point(pSpr.rect.left, pSpr.rect.bottom + 2), 1)
- end
-
- on mouseLeave me
- hideToolTip()
- end
-
- on mShowDrinkContents me, tipText, forceUpdateToText
- if not forceUpdateToText then
- if pSpr.visible = 0 then
- exit
- end if
- end if
- if not voidp(tipText) then
- if pSpr.member.text <> tipText then
- pSpr.member.text = tipText
- pSpr.member.Tabs = pOldTabs
- end if
- end if
- notifyPourWindow(me)
- end
-
- on mShowIfPreviouslyVisible me
- if pLastVisible then
- mShowDrinkContents(me, VOID, 1)
- pSpr.visible = 1
- end if
- end
-
- on mouseDown me
- if the doubleClick then
- mHideDrinkContents()
- exit
- end if
- startLoc = pSpr.loc
- myOffset = the clickLoc - point(pSpr.left, pSpr.top)
- repeat while the stillDown
- checkElapsedTime()
- pSpr.loc = the mouseLoc - myOffset
- updateStage()
- end repeat
- if not rectOnStage(pSpr.rect) then
- pSpr.loc = startLoc
- mHideDrinkContents(me)
- else
- if pSpr.loc <> startLoc then
- undockText(me)
- end if
- end if
- end
-
- on mHideIfDocked me
- if pLastDirection <> #undocked then
- mHideDrinkContents(me)
- end if
- end
-
- on mHideDrinkContents me
- pSpr.visible = 0
- oldDirection = pLastDirection
- pLastDirection = #undocked
- notifyPourWindow(me)
- pLastDirection = oldDirection
- end
-
- on mRepositionSelf me, direction, visFlag
- global gPourWindow
- if voidp(gPourWindow) then
- exit
- end if
- if not voidp(direction) then
- pLastDirection = direction
- end if
- if not voidp(visFlag) then
- pSpr.visible = visFlag
- pLastVisible = visFlag
- end if
- if pSpr.visible = 0 then
- exit
- end if
- pwRect = offset(gPourWindow.rect, -(the stageLeft), -(the stageTop))
- startLoc = pSpr.loc
- if rectOnStage(pwRect) then
- case pLastDirection of
- #right:
- pSpr.loc = point(pwRect.right + 3, pwRect.top + 3)
- #bottom:
- pSpr.loc = point(pwRect.left, pwRect.bottom + 3)
- #left:
- pSpr.loc = point(pwRect.left - pSpr.rect.width, pwRect.top + 3)
- end case
- updateStage()
- if not rectOnStage(pSpr.rect) then
- pSpr.loc = startLoc
- undockText(me)
- end if
- else
- undockText(me)
- end if
- end
-
- on undockText me
- pLastDirection = #undocked
- notifyPourWindow(me)
- end
-
- on notifyPourWindow me
- global gPourWindow
- if isWindow(gPourWindow) then
- tell gPourWindow
- reinstateArrows(pLastDirection)
- end tell
- end if
- end
-